/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ia_psr.algoritmos;

/**
 *
 * @author Rubén Avalos Elvira y Fabiana Celiberti Tapie
 */

import ia_psr.graph.Nodo;
import ia_psr.graph.NodoPSR;
import java.util.PriorityQueue;
public class PSRGradoHeuristico extends PSRBacktracking {
    protected PriorityQueue<NodoPSR> q;

    public PSRGradoHeuristico() {
        super();
        q = new PriorityQueue<NodoPSR>();
    }

    public NodoPSR nextNode() {
        q.clear();
        for (Nodo nodo : g.getNodos()) {
            NodoPSR n = (NodoPSR)nodo;
            if (n.valor.getValue() == null)
                q.add(n);
        }
        return q.peek();
    }
}
